package com.lagou.dao.mapper;

import com.lagou.dao.pojo.PasswordLog;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PasswordLogMapper {

    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "email", column = "email"),
            @Result(property = "password", column = "password")
    })
    @Select("select * from lagou_password where email = #{0}")
    public List<PasswordLog> findUserPassword(String email);

    @Select("select * from lagou_password where email = #{0} and password = #{1}")
    public List<PasswordLog> findUserPassword1(String email, String password);

    @Insert("insert into lagou_password (email, password) values (#{email}, #{password})")
    public int insertPassword(PasswordLog passwordLog);

    @Update("update lagou_password set password = #{password} where email = #{email}")
    public int updatePassword(PasswordLog passwordLog);
}
